import { createRouter, createWebHistory } from 'vue-router'
export const conrouters = [
    // 首页
    {
        path: '/',
        name: 'Index',
        component: () => import('@/views/Layout.vue'),
        redirect: '/home',
        meta: {
            title: 'Layout',
            icon: '首页',
            hidden: true
        },
        children: [
            {
                path: '/home',
                name: 'Home',
                component: () => import('@/views/Home.vue'),
                meta: {
                    title: '首页',
                    icon: '首页',
                    hidden: true
                }
            }
        ]
    },
  
    // 404页面
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/404.vue'),
        meta: {
            title: '404',
            icon: '404',
            hidden: false
        }
    },
    //任意路由
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: false,
            icon: '任意路由',
        },
    },
    //资料管理
    {
        path: '/reci',
        name: 'Reci',
        component: () => import('@/views/Layout.vue'),
        meta: {
            title: '资料管理',
            icon: '资料管理',
            hidden: true
        },
        children: [
            {
                path: '/recipients',
                name: 'Recipients',
                component: () => import('@/views/reci/Recipients.vue'),
                meta: {
                    title: '收件人',
                    icon: '收件人',
                    hidden: true
                }
            },
            {
                path: '/certificateCode',
                name: 'CertificateCode',
                component: () => import('@/views/reci/CertificateCode.vue'),
                meta: {
                    title: '运输报告',
                    icon: '运输报告',
                    hidden: true
                }
            },
            {
                path: '/spbInformation',
                name: 'SPBInformation',
                component: () => import('@/views/reci/SPBInformation.vue'),
                meta: {
                    title: '产品计划',
                    icon: '产品计划',
                    hidden: true
                }
            }
        ]
    },
    //创建邮件
    {
        path: '/outlook',
        name: 'Outlook',
        component: () => import('@/views/Layout.vue'),
        meta: {
            title: '邮件管理',
            icon: '邮件管理',
            hidden: true
        },
        children: [
            {
                path: '/createEmail',
                name: 'CreateEmail',
                component: () => import('@/views/outlook/CreateEmail.vue'),
                meta: {
                    title: '创建邮件',
                    icon: 'outlook',
                    hidden: true
                }
            }
        ]
    },
]


const router = createRouter({
    history: createWebHistory(), // 使用hash模式
    routes: conrouters // 静态路由
})


export default router
